package com.coco.proxy;

import com.coco.model.*;
import com.coco.utils.CoPageResp;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author GHOSTLaycoo
 * @date 2020/4/16 0016 - 上午 10:19
 */
@FeignClient(value = "manager-service")
public interface ManagerFeign {
    @PostMapping("/navi/getNaviByCondition")
    ResponseEntity<List<NaviInfo>> getNaviByCondition(@RequestBody NaviInfoCondition naviInfoCondition);

    @ApiOperation(value = "查询视频数据")
    @PostMapping("/video/getVideosByCondition")
    ResponseEntity<CoPageResp<VideoModel>> getVideosByCondition(@RequestBody VideoCondition videoCondition);

    @ApiOperation(value = "通过id获取视频数据")
    @GetMapping("/video/getVideoById/{id}")
    ResponseEntity<VideoModel> getVideoById(@PathVariable("id") String id);

    @ApiOperation(value = "保存收藏")
    @PostMapping("/collection/saveCollection")
    ResponseEntity<Integer> saveCollection(@RequestBody CollectionCondition collectionCondition);

    @ApiOperation(value = "删除收藏")
    @PostMapping("/collection/deleteCollection")
    ResponseEntity<Integer> deleteCollection(@RequestBody CollectionCondition collectionCondition);

    @ApiOperation(value = "搜索")
    @PostMapping("/collection/selectCollection")
    ResponseEntity<Integer> selectCollection(@RequestBody CollectionCondition collectionCondition);

    @ApiOperation(value = "通过userId查询收藏数据")
    @GetMapping("/collection/selectCollectionByUserId/{userId}")
    ResponseEntity<List<VideoModel>> selectCollectionByUserId(@PathVariable("userId") String userId);

    @ApiOperation(value = "新增浏览记录")
    @PostMapping("/record/save")
    ResponseEntity<Integer> save(@RequestBody RecordModel recordModel);

    @ApiOperation(value = "批量删除浏览记录")
    @DeleteMapping("/record/delete/{userId}")
    ResponseEntity<Integer> delete(@PathVariable("userId") String userId);

    @ApiOperation(value = "查询浏览记录")
    @GetMapping("/record/searchRecord/{userId}")
    ResponseEntity<List<RecordInfo>> searchRecord(@PathVariable("userId") String userId);

    @ApiOperation(value = "修改视频点赞次数")
    @PutMapping("/video/updateWatch/{id}/{sum}")
    ResponseEntity<Integer> updateStar(@PathVariable("id") String id,@PathVariable("sum") int sum);
}
